package lims.client;


import javax.swing.JFrame;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;


@Service
public class LimsPrintManager {
	private static Log logger=LogFactory.getLog(LimsPrintManager.class);
	public static ApplicationContext applicationContext;
	
	public static void main(String[] args) throws Exception {
		new LimsPrintManager().start(args);
	}
	
	public void start(String[] args) throws Exception{
		LimsPrintManager.applicationContext= new ClassPathXmlApplicationContext("applicationContext.xml");
		
		MainFrame mainFrame=new MainFrame();
		
		LimsService limsService=(LimsService) applicationContext.getBean("limsService");
		limsService.start();
		mainFrame.setLimsService(limsService);		
		
    	mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
    	mainFrame.setSize(800, 600);  
    	mainFrame.setLocationByPlatform(true);  
    	mainFrame.setVisible(true);  
		logger.info("finished");
	}
	
}
